home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / dskutil / lqmx444.zip / LQMATRIX.PAS < prev    next >
Pascal/Delphi Source File  |  1993-07-07  |  8KB  |  232 lines

  1. {$R-}    {Range checking off}
  2. {$B+}    {Boolean complete evaluation on}
  3. {$S+}    {Stack checking on}
  4. {$I+}    {I/O checking on}
  5. {$N-}    {No numeric coprocessor}
  6. {$M 55520,0,655360} {40500 stack seems to work}
  7.  
  8. program LQMATRIX;
  9.  
  10. { This program permits you to create your own characters for the
  11.    Epson LQ-1500 ver 2 and all the successors LQ800 etc.
  12.  
  13.                                copyright by J. David Sapir
  14. DOS version                    906 Old Farm Rd.
  15.                                Charlottesville, VA. 22903
  16.                                (804) 295-5496
  17. First version: 30.xi.87        [Jimmy Paris Software]             }
  18.  
  19.  
  20. Uses
  21.   Crt, {Unit found in TURBO.TPL}
  22.   Dos, {Unit found in TURBO.TPL}
  23.   Printer, {Unit found in TURBO.TPL}
  24.   LQMXINIT, {All global types, const & variables}
  25.   LQUTIL,   {fairly simple minded utilities}
  26.   LQCURSOR,
  27.   KEYBOARD, {Constants to carry Alt F1.. Ctrl keys, etc.}
  28.   WIN,     {Replaces the old QUICK. Includes Borland's pop up windows}
  29.   LQcadre, {new version of Cadre that makes use of Borland's
  30.             writechr, writestr procedures rather than the print porcedure
  31.             from TUG}
  32.   
  33.   LQMENU,
  34.   LQHELP,
  35.   LQDIRECT, {directory routines}
  36.   LQCOMMND, {read the command line routines}
  37.   LQEDIT1,  {all disk I/O routines}
  38.   LQEDIT2,  {convertion of bytes to booleans & viceversa}
  39.   LQEDIT3,  {all lst (printer) routines}
  40.   LQEDIT4,  {the matrix editor - has LQEDIT5 as an include file}
  41.   LQSETUP,  {getting started}
  42.   BURNIN;   {routine to write indentification string to .EXE}
  43.  
  44.  
  45. var
  46.     choice2    : char;
  47.     reset_scr,
  48.     scan,
  49.     done       : boolean;
  50.  
  51. begin
  52.  clrscr;
  53.  done:=false;
  54.  windowcount:=0;
  55.  topwindow:=nil;
  56.  holdmtx:=nil;
  57.  start_attr:=textattr;
  58.  currentmode:=GetCurrentMode;
  59.  {get the allowable range & screen attributes from the LQX.DEF file}
  60.  getSetUp;
  61.  {set the new attributes}
  62.  textattr:=video;
  63.  title;
  64.  array_loaded:=false;  {help array gets loaded up once - Cf lqhelp.pas}
  65.  
  66.  read_command(com_call,com_present,f_info,ph,mk);
  67.    if not (IOerr in[0,2,5]) then com_call:=false;
  68.  startingUP:=true;
  69.  
  70.  initialize(characterSet,
  71.             workmatrix,
  72.             micundomtx,macundomtx,
  73.             rightmatrix,undoright,
  74.             lastchar,mtx_show,
  75.             rgt_show,
  76.             chIn,saved,
  77.             com_call,com_present,
  78.             f_info,ph,mk);
  79.  startingUP:=false;
  80.  repeat
  81.     repeat
  82.       choice:=upCase(getkey(scan));
  83.       until (choice in[esc,'E','M','N','P'..'S','V',F1,AltX]);
  84.     case choice of
  85.      F1: if scan then
  86.      SimpleHelp(3);
  87.      'E':                                            { Call editor    }
  88.         begin
  89.           closewindow;
  90.           Edit(workmatrix,
  91.                micundomtx,macundomtx,
  92.                rightmatrix,undoright,
  93.                characterset,lastchar,
  94.                mtx_show,
  95.                rgt_show,
  96.                character,f_info,
  97.                ph,mk);
  98.           Menu(f_info.size);
  99.         end;
  100.      'N':                                            { Get a new file }
  101.        Begin
  102.          closewindow;
  103.          if (not Saved) and (LastChar>0) then
  104.             if SaveQuery(f_info.name)
  105.                then putcharfile(characterset,saved,f_info,ph,mk);
  106.          com_call:=false; com_present:=false;
  107.          initialize(characterSet,
  108.                     workmatrix,
  109.                     micundomtx,macundomtx,
  110.                     rightmatrix,undoright,
  111.                     lastchar,mtx_show,
  112.                     rgt_show,
  113.                     chIn,saved,
  114.                     com_call,com_present,
  115.                     f_info,ph,mk);
  116.        end;
  117.      'S':
  118.         begin  { Store file on disk }
  119.           closewindow;
  120.           PutCharFile(CharacterSet,saved,f_info,ph,mk);
  121.       FileTitle(f_info.showname);
  122.           Menu(f_info.size);
  123.  
  124.         end;
  125.       'V': version;
  126.       'R': if burn.regNO=baseNO then
  127.                Prn_Reg; {Print out a registration form - routine
  128.                         is in LQEDIT3 - with other print routines }
  129.  
  130.      {********** MISCELLANEOUS MENU ROUTINE ***********}
  131.       'M':
  132.          begin
  133.            miscellaneous;
  134.            reset_scr:=false;
  135.            repeat
  136.              choice2:=upCase(getkey(scan));
  137.              if choice2 in[^I,^R,'U','C','R','S',F1,'F'] then
  138.                case choice2 of
  139.                   F1: simpleHelp(5);
  140.                  'F': change_Fattr(f_info);
  141.                  'C':  {combine two files}
  142.                    CombineFile(characterset,lastchar,saved,
  143.                                f_info,ph,mk);
  144.                  'S':  {simple sort after combining files}
  145.                    Sort;
  146.                  'R':
  147.                     if burn.regNO<>baseNO then
  148.                         unRegister; {this is in BURNIN -
  149.                                      sets burn.NOreg to baseNO}
  150.                  'U':  {change highlighting and ASCII range}
  151.                    SetUP(reset_scr);
  152.                  ^I:
  153.                    change_regNO;
  154.                  ^R:
  155.                    change_ID;
  156.                end; {case}
  157.            until choice2<>F1;
  158.            closewindow; {C-16}
  159.            if (choice2 in['C','R','S',^I]) or (reset_scr) then
  160.               begin
  161.                 {you have to close the windows before you
  162.                  can move into the default space - unless
  163.                  we want to define Status as a window.}
  164.                 closewindow;
  165.                 if reset_scr then
  166.                    begin
  167.                      frames(default);
  168.                      textattr:=video;  {since previous textattr is restored
  169.                                       when you close a window we have to
  170.                                       set it here rather than in the setup
  171.                                       procedure}
  172.                      rgt_show:=false;
  173.                      mtx_show:=false;
  174.                      show_matrix(workmatrix.matrix,f_info);
  175.                    end;
  176.         if (reset_scr) or (choice2='C') then
  177.             FileTitle(f_info.showname);
  178.                 status(CharacterSet,LastChar,from_bottom);
  179.                 Menu(f_info.size);
  180.               end;
  181.          end;
  182.       {********** PRINT ROUTINES MENU ******************}
  183.       'P':
  184.          begin
  185.            prn_routines;
  186.            repeat
  187.              choice2:=upCase(getkey(scan));
  188.              if choice2 in['D','F','O','P','R','T',F1] then
  189.                case choice2 of
  190.                  F1: SimpleHelp(6);
  191.                  'D','F','P','T': { Download file to printer }
  192.                     begin
  193.                       if okprint then
  194.                         case choice2 of
  195.                           'D': if lastchar>0 then
  196.                                   DownloadFile(characterset,lastchar,
  197.                                                f_info.size);
  198.                           'F': if lastchar>0 then
  199.                                   PrintFile(characterSet,f_info.name,
  200.                                             f_info.size);
  201.                           'P': if lastchar>0 then
  202.                                   print_out(characterset,lastChar,
  203.                                             f_info.size);
  204.                           'R': begin
  205.                                  setPrinterUp(f_info.size);
  206.                                  reset_note;
  207.                                end;
  208.                           'T': if lastchar>0 then
  209.                                   Type_KBD(characterset,lastChar,
  210.                                            f_info.size);
  211.                         end;
  212.                     end;
  213.                  end; {case}
  214.            until choice2<>F1;
  215.            closewindow;
  216.          end;
  217.        esc,'Q',AltX:
  218.          if (scan) or (choice in['Q',esc]) then
  219.             if ask_Exit then done:=true;
  220.  
  221.      end; { of Command case }
  222.      GotoXY(9,4); NoCursor;
  223.  until done;
  224.  if (not Saved) and (lastChar>0) then
  225.     if SaveQuery(f_info.name) then
  226.      putcharfile(characterset,saved,f_info,ph,mk);
  227.  closewindow;
  228.  time_to_go('Jimmy Paris Software',0,0);
  229. end.
  230.  
  231. { end of LQMATRIX.PAS  ---- copyright by J. David Sapir }
  232.